import request from "@/utils/request";

//#region 个人计算机管理
//个人计算机管理列表  默认计算机 私人计算机 共有计算机
export const list = () => {
  return request({
    url: "/ad/personalComputer/list",
    method: "get"
  });
};

//计算机信息
export const info = sAMAcountName => {
  return request({
    url: `/ad/computer/${sAMAcountName}/info`,
    method: "get"
  });
};
//个人计算机管理 绑定私人计算机
export const bind = samAccountName => {
  return request({
    url: `/ad/personalComputer/${samAccountName}/bind`,
    method: "post"
  });
};

//个人计算机管理 解绑私人、公有计算机
export const unbind = (samAccountName, computerType) => {
  return request({
    url: `/ad/personalComputer/${samAccountName}/unbind`,
    method: "post",
    params: { computerType }
  });
};

//个人计算机管理 添加私人计算机
export const addPersonComputer = () => {
  return request({
    url: `/ad/personalComputer/addPersonComputer`,
    method: "post"
  });
};

//个人计算机管理 删除计算机
export const deleteComputer = samAccountName => {
  return request({
    url: `/ad/computer/${samAccountName}/delete`,
    method: "delete"
  });
};
//#endregion
export default {
  info,
  list,
  bind,
  unbind,
  addPersonComputer,
  deleteComputer
};
